#ifndef GLSCENE_H_
#define GLSCENE_H_

#include <vector>
#include <map>
#include <string>

#include "GameState.h"
#include "SDLCanvas.h"
#include "GLTextures.h"
#include "GameMap.h"
#include "Timer.h"
#include "SiteCoordinate.h"
#include "PathCoordinate.h"
#include "MouseMotionArtifacts.h"

namespace catan
{

class GLScene
{
public:
	GLScene(GameState &gameState, SDLCanvas &sdlCanvas, GLTextures &glTextures, GameMap &gameMap);
	virtual ~GLScene();
	void poll();
	void draw();
	void click(int x, int y);
	static const float textTop;							//the first line at the Top of the text
	static const float textLeft;							//the top left of the text area
	static const float textHeight;						//main text height
	static const float textWidth;				//this is 1 character width
	ResourceSet TradeIn;					//TradeIn  = OFFER of resources.
	ResourceSet TradeFor;					//TradeFor = DEMAND of resources.

private:
	//void queryAddRoad();
	//void queryAddSettlement();
	GameState *gameStateRef;
	SDLCanvas *sdlCanvasRef;
	GLTextures *glTexturesRef;
	GameMap *gameMapRef;
	int frame;
	int turnCounter;	// used for the first turn mainly
	Timer timer;
	// check the validity of the coordinates (if are according to the game requirements)
	bool isOkToPlaceRoad(PathCoordinate theCoordinate);
	bool isOkToPlaceSettlement(SiteCoordinate theCoordinate);
	bool clickedStartTrade;						//used to show the trade question
	bool clickedTradeBank;						//started trading with bank
	bool clickedTradePlayers;					//started trading with players
	bool madeTradeOffer;
	bool acceptPlayerTrade;
	int nextPlayerIndex;					//holds the index of the next player
	std::vector<Player*> PlayersAcceptedTrade;			//these players accepted the offer of another player
	int woodMultiplier, sheepMultiplier, wheatMultiplier, brickMultiplier, oreMultiplier;
	MouseMotionArtifacts mouseMotionArtifacts;
	bool noGeneralHarborBool;	//start with the assumption that there is no general harbor; set false when general harbor is found for that player
	bool noHarborAtAll;		
	bool playerTradeCompleted;			//used to indicate a succesfull player trade transaction
	//int playerTraderIndex;				//index of player that a succesfull player trade transaction occured
	std::string playerTraderName;
};


}

#endif /*GLSCENE_H_*/
